/*package org.domain.pseample.session;

import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.security.Credentials;
import org.jboss.seam.security.Identity;
import org.mobicents.mscontrol.MsLink;

import org.mobicents.mscontrol.MsLinkListener;
import org.mobicents.mscontrol.MsLinkEvent;
import org.mobicents.mscontrol.MsEndpoint;

import org.apache.log4j.Logger;

@Name("connectsinglecall")
public class ConnectSingleCall {
	
	
	@In
	Identity identity;
	@In
	Credentials credentials;

	private static Logger logger = Logger
	.getLogger(ConnectSingleCall.class);
	
	public void call(String user)
	{
		System.out.println(user + credentials.getUsername());
		MapInstance mapInstance = MapInstanceManager.instance()
		.getMapInstance(user);
		
		MsLink mslink = mapInstance.getMsLink();
		
		
		mslink.addLinkListener(new MsLinkListener() {
			public void linkCreated(MsLinkEvent linkEvent) {
				logger.info("PR-IVR link created " + linkEvent);

			}

			public void linkConnected(MsLinkEvent linkEvent) {
				
				// mslink.getEndpoints()[0].execute();
			}

			public void linkDisconnected(MsLinkEvent arg0) {
				// TODO Auto-generated method stub

			}

			public void linkFailed(MsLinkEvent arg0) {
				logger.info("link failed");

			}

			public void modeFullDuplex(MsLinkEvent arg0) {
				// TODO Auto-generated method stub

			}

			public void modeHalfDuplex(MsLinkEvent arg0) {
				// TODO Auto-generated method stub

			}
		});
		
		
		
		MapInstance caller=MapInstanceManager.instance()
		.getMapInstance(credentials.getUsername());
		
		MapInstance calleeInstance=MapInstanceManager.instance()
		.getMapInstance(user);
		
		
		calleeInstance.getPushServerMessage().push(caller.getUserName());
		
		MsEndpoint callerEndpoint = caller.getMsConnection().getEndpoint();

		MsEndpoint calleeEndpoint = calleeInstance.getMsConnection().getEndpoint();
		
		
		mslink.join(calleeEndpoint.getLocalName(), callerEndpoint.getLocalName());
		
		

	}
	
}*/